package com.azzcs.juc.product_consumer;

/**
 * @Author: wzg
 * @Date: 2021/6/15 下午2:15
 */
public class P implements Runnable {

    private Q q;
    private String name;

    public P(Q q, String name) {
        this.q = q;
        this.name = name;
    }

    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            String data = name+"-"+i;
            System.out.println("product "+name+":"+data);
            q.put(data);
        }
    }
}
